App({
    globalData: {
      userType: null, // 'student' or 'worker'
      userInfo: null,
      openId: null,
      sessionKey: null,
      globalcusData: {
        usermessage: null
      },
      globalworkerdata: {
        workermessage: null
      },
      customer: {
        usermessage: null
      },
      worker: {
        workermessage: null
      },
      token: null,
      Score: 0
    },
    getToken() {
      return wx.getStorageSync('token');
    },
    setToken(token) {
      wx.setStorageSync('token', token);
      this.globalData.token = token;
    },
    setScore: function (score) {
        this.globalData.Score = score;
    },
    getScore: function () {
      return this.globalData.Score;
    },
    onLaunch: function () {
      const logs = wx.getStorageSync('logs') || [];
      logs.unshift(Date.now());
      wx.setStorageSync('logs', logs);
       
    }
  })